package org.com.structuralPattern.flyweightPattern;

/**
 * @author Jonny
 * @version 1.0
 * @Description:
 * @date 2021/4/15 15:06
 */
public class ChesspieceFactory {
    static final Chesspiece WHITE=new ChesspieceFlyweight("白");
    static final Chesspiece BLACK=new ChesspieceFlyweight("黑");

    public static Chesspiece getChesspiece(String color){
        if(color.equals("白")){
            return WHITE;
        }else if (color.equals("黑")){
            return BLACK;
        }
        return null;
    }

}
